package gvo.util;
/** 
*  Copyright 1999-2002 Matthew Robinson and Pavel Vorobiev. 
*  All Rights Reserved. 
* 
*  =================================================== 
*  This program contains code from the book "Swing" 
*  2nd Edition by Matthew Robinson and Pavel Vorobiev 
*  http://www.spindoczine.com/sbe 
*  =================================================== 
* 
*  The above paragraph must be included in full, unmodified 
*  and completely intact in the beginning of any source code 
*  file that references, copies or uses (in any way, shape 
*  or form) code contained in this file. 
*/
import java.io.File;
public class SimpleFilter extends javax.swing.filechooser.FileFilter {
	private String m_description = null;
	private String m_extension = null;
	public SimpleFilter(String extension, String description) {
		this.m_description = description;
		this.m_extension = "." + extension.toLowerCase();
	}
	public String getDescription() {
		return this.m_description;
	}
	public boolean accept(File f) {
		if (f == null)
			return false;
		if (f.isDirectory())
			return true;
		return f.getName().toLowerCase().endsWith(this.m_extension);
	}
}

